#!/bin/bash
echo -e "begin build faceEngine lib\n========================================="

script_dir=`cd $(dirname $0) && pwd`

for abi in "armeabi-v7a" "arm64-v8a"
do
    build=build-$abi
    rm -rf $build
    mkdir $build
    cd $build

    cmake .. \
        -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DANDROID_ABI="$abi" \
        -DANDROID_STL=c++_static \
        -DANDROID_NATIVE_API_LEVEL=android-17  \
        -DANDROID_TOOLCHAIN=clang \
        -DANDROID=ON

    make -j4

    cd $script_dir
done

echo -e "build for android done!\n"
